/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("mes_ordermanagement",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using LDR.DingManageMent.IServices;
using VOL.Core.Filters;

namespace LDR.DingManageMent.Controllers
{
    public partial class mes_ordermanagementController
    {
        private readonly Imes_ordermanagementService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public mes_ordermanagementController(
            Imes_ordermanagementService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }
        [ApiActionPermission("mes_ordermanagement", VOL.Core.Enums.ActionPermissionOptions.Search)]
        [HttpGet]
        public IActionResult UpdStatus(string? o_number)
        {
            var count = _service.UpdShenhe(o_number);
            return Ok(count);
        }
        [ApiActionPermission("mes_ordermanagement", VOL.Core.Enums.ActionPermissionOptions.Search)]
        [HttpGet]
        [Route("Fan")]
        public IActionResult UpdStatus2(string? o_number)
        {
            var count = _service.UpdShenhe2(o_number);
            return Ok(count);
        }
        [ApiActionPermission("mes_ordermanagement", VOL.Core.Enums.ActionPermissionOptions.Search)]
        [HttpPost("Xiafa")]
        public IActionResult AddProduction([FromBody]MES_Production pro)
        {
            var count = _service.XiaFa(pro);
            return Ok(count);
        }
        [ApiActionPermission("mes_ordermanagement", VOL.Core.Enums.ActionPermissionOptions.Search)]
        [HttpPost("UpdMoney")]
        public IActionResult UpdOrderMoney([FromBody] int all_price)
        { 
            var count=_service.UpdPrice(all_price);
            return Ok(count);
        }
    }
}
